package com.xpec.c4.service.contexts;

/**
 * 上下文context接口
 * 
 * @author lipeilin
 * 
 */
public interface Context {

	/**
	 * Get a value by name.
	 */
	public Object get(String name);

	/**
	 * Set a value.
	 */
	public void set(String name, Object value);

	/**
	 * Unset a value.
	 */
	public void remove(String name);

	/**
	 * Is the value set?
	 */
	public boolean isSet(String name);

	/**
	 * Get all names defined in the context.
	 */
	public String[] getNames();

	/**
	 * Force synchronization to the underlying state store.
	 * 
	 * Some implementations of Context "persist" state back to the underlying
	 * store synchronously, others asynchronously. This method is usually called
	 * by Seam, when necessary.
	 */
	public void flush();

	/**
	 * clear all object
	 */
	public void clear();

	/**
	 * Get the scope that this context object is associated with,
	 */
	public ScopeType getType();

}
